import React, { useEffect, useState } from "react";
import request, { baseUrl } from "../utils/request";
import { Route, useSearchParams, Routes } from "react-router-dom";
import { Row, Col, Image, Layout, Tag, Space, Button } from 'antd'
import { connect } from "react-redux";

import Title from "./detail/Title";
import Dowload from './detail/Dowload'
import Comment from './detail/Comment'
import Correlation from "./detail/Correlation";


const { Header, Footer, Sider, Content } = Layout;
// import {use}
function Detail({ user }) {

    const id = user.userInfo.id
    // console.log(id);
    const [params, setParams] = useSearchParams()
    const movieID = params.get('movieID')
    // console.log(movieID);
    // useEffect(() => {
    //     request({
    //         url: '/user/history',
    //         method: 'post',
    //         data: {
    //             id,
    //             movieID
    //         }
    //     })
    // }, [])
    return (
        <div>
            <Title></Title>
            <Dowload movieID={movieID} />
            <Comment />
            <Correlation />

        </div>
    )

}

const mapStateToProps = function (state) {
    // console.log('state', state);
    return { user: state }
}
const mapDispatchToProps = function (dispatch) {
    return {

    }
}
Detail = connect(mapStateToProps, mapDispatchToProps)(Detail)

export default Detail